import { createRouter, createWebHistory } from 'vue-router';

const routes = [
  {
    path: '/',
    name: 'Home',
    redirect: '/index',
  },
  {
    path: '/hpurchase/goodsManagement/attributeManagement',
    name: 'attributeManagement',
    component: () =>
      import(
        /* webpackChunkName: "goodsManagement" */ '@/views/goods/goodsManagement/attributeManagement/index.vue'
      ),
    meta: {
      title: '属性管理',
    },
  },
  {
    path: '/hpurchase/goodsManagement/attributeManagementAdd',
    redirect: '/hpurchase/goodsManagement/attributeManagement/add',
  },
  {
    path: '/hpurchase/goodsManagement/attributeManagement/add',
    name: 'attributeManagementCreate',
    component: () =>
      import(
        /* webpackChunkName: "goodsManagement" */ '@/views/goods/goodsManagement/attributeManagement/attributeManagementAdd.vue'
      ),
    meta: {
      title: '新增属性',
    },
  },
  {
    path: '/hpurchase/goodsManagement/attributeManagement/edit',
    name: 'attributeManagementEdit',
    component: () =>
      import(
        /* webpackChunkName: "goodsManagement" */ '@/views/goods/goodsManagement/attributeManagement/attributeManagementAdd.vue'
      ),
    meta: {
      title: '编辑属性',
    },
  },
  {
    path: '/hpurchase/goodsManagement/attributeManagement/detail',
    name: 'attributeManagementDetail',
    component: () =>
      import(
        /* webpackChunkName: "goodsManagement" */ '@/views/goods/goodsManagement/attributeManagement/attributeManagementAdd.vue'
      ),
    meta: {
      title: '属性详情',
    },
  },
  {
    path: '/hpurchase/goodsManagement/categoryManagement',
    name: 'categoryManagement',
    component: () =>
      import(
        /* webpackChunkName: "goodsManagement" */ '@/views/goods/goodsManagement/categoryManagement/index.vue'
      ),
    meta: {
      title: '分类管理',
    },
  },
  {
    path: '/hpurchase/goodsManagement/categoryManagementAdd',
    redirect: '/hpurchase/goodsManagement/categoryManagement/add',
  },
  {
    path: '/hpurchase/goodsManagement/categoryManagement/add',
    name: 'categoryManagementCreate',
    component: () =>
      import(
        /* webpackChunkName: "goodsManagement" */ '@/views/goods/goodsManagement/categoryManagement/categoryManagementAdd.vue'  
      ),
    meta: {
      title: '新增分类',
    },
  },
  {
    path: '/hpurchase/goodsManagement/categoryManagement/edit',
    name: 'categoryManagementEdit',
    component: () =>
      import(
        /* webpackChunkName: "goodsManagement" */ '@/views/goods/goodsManagement/categoryManagement/categoryManagementAdd.vue'  
      ),
    meta: {
      title: '编辑分类',
    },
  },
  {
    path: '/hpurchase/goodsManagement/categoryManagement/detail',
    name: 'categoryManagementDetail',
    component: () =>
      import(
        /* webpackChunkName: "goodsManagement" */ '@/views/goods/goodsManagement/categoryManagement/categoryManagementAdd.vue'  
      ),
    meta: {
      title: '分类详情',
    },
  },
];

const router = createRouter({
  history: createWebHistory(process.env.BASE_URL),
  routes,
});

export default router;
